#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
//nĽ׳---ѭ
int Fact(int n)
{
	int i = 0;
	int ret = 1;
	for (i = 1; i <= n; i++)
	{
		ret *= i;//ret = ret * i
	}
	return ret;
}




int main()
{
	int n = 0;
	scanf_s("%d", &n);
	int r = Fact(n);
	printf("%d", r);

	return 0;
}






/*要对输入的n是否小于0进行判断*/
int factorial(int n)
{
	int result = 1;//创建一个临时变量
	for (int i = 1; i <= n; i++)
	{
		result *= i;//ret = ret * i
	}
	return result;
}

int main()
{
	int n;
	scanf("%d", &n);
	if (n < 0)
	{
		printf("Factorial is not defined for negative integers.\n");
	}
	else
	{
		int ret = factorial(n);
		printf("%d的阶乘是%d\n", n, ret);
	}

	return 0;
}